//
// Created by Semir on 2020/6/10.
//

#include <iostream>
#include <vector>

using namespace std;

/*
 * 给定一个数组 A[0, 1,..., n-1]，请构建一个数组 B[0, 1,..., n-1]
 * 其中 B 中的元素 B[i]=A[0]*A[1]*...*A[i-1]*A[i+1]*...*A[n-1]
 * 要求不能使用除法
 * */

vector<int> multiply(const vector<int>& A) {
    if (A.empty()) {
        return A;
    }
    vector<int> B(A.size(), 1);
    int left = 1;
    for (int i = 0; i < B.size() - 1; i++) {
        left *= A[i];
        B[i + 1] *= left;
    }
    int right = 1;
    for (int i = B.size() - 1; i > 0; i--) {
        right *= A[i];
        B[i - 1] *= right;
    }
    return B;
}

int main() {
    vector<int> A = {};
    vector<int> B = multiply(A);
    cout << B.size() << endl;
    return 0;
}